// 这个是用来干嘛的 就是给表单提供数据的
import { reactive } from 'vue'
import { MenuAdd } from '@/api/menu/MenuModules'
export default function useBaseModel() {
  const rules = reactive({
    name: [{
      required: true,
      message: '请填写菜单名称',
      trigger: 'blur',
    }],
    code: [{
      required: true,
      message: '请填写菜单ID',
      trigger: 'blur',
    }],
    nodeIcon: [{
      required: true,
      message: '请选择菜单图标',
      trigger: 'change',
    }],
    nodeType: [{
      required: true,
      message: '请选择菜单类型',
      trigger: 'change',
    }],
    parentId: [{
      required: true,
      message: '请填写父级菜单',
      trigger: 'blur',
    }],
    router: [{
      required: true,
      message: '请填写菜单路径',
      trigger: 'blur',
    }],
   
  })
  const dialogModel = reactive<MenuAdd>({
    code: '',
    id: '',
    name: '',
    nodeIcon: '',
    nodeType: '',
    parentId: '',
    router: '',
    sort: ''
  })
  return {
    rules, dialogModel
  }
}